package service

import (
	"gitee.com/kordar/bucket/model"
	"github.com/kordar/goupload"
	"mime/multipart"
)

type BucketService interface {
	GetBucket(id int64) (model.Bucket, error)
}

type BucketUploaderService interface {
	Upload(id int64, targetFilePath string, file *multipart.FileHeader) error
	UploadFromFile(id int64, targetFilePath string, sourceFilePath string) error
	Download(id int64, filename string) ([]byte, error)
	DownloadToFile(id int64, filename string, targetLocalPath string) error
	List(id int64, dir string, next interface{}, page int, limit int, subCount bool) ([]goupload.BucketObject, interface{})
	Count(id int64, dir string) int
	Del(id int64, name string) error
	DelAll(id int64, dir string)
	DelMulti(id int64, objects []goupload.BucketObject) error
	IsExist(id int64, name string) (bool, error)
	Copy(id int64, dest string, source string) error
	Move(id int64, dest string, source string) error
	Rename(id int64, dest string, source string) error
	Tree(id int64, dir string, next interface{}, page int, limit int, dep int, maxDep int, noleaf bool, subCount bool) []goupload.BucketTreeObject
}
